﻿<%@ Page Title="" Language="C#" MasterPageFile="~/administrator/Admin.Master" AutoEventWireup="true"
    CodeBehind="SmsClassManager.aspx.cs" Inherits="ServerApi.administrator.SmsClassManager" %>

<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Title" runat="server">
Quản lý Command SMS
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Script" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
<div>
        <strong style="font-size: 18px; text-transform: uppercase">Quan ly Command SMS</strong>
    </div>
    <br />
    <div>
        <strong>Tìm kiếm Command SMS</strong>
    </div>
    <div>
        <table>
            <tr>
                <td>
                    Đối tác:
                </td>
                <td>
                    <asp:DropDownList ID="ddlPartnerSearch" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlPartnerSearch_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td style="width: 40px">
                    &nbsp;
                </td>
                <td>
                    &nbsp;Command Code:
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtCommandSearch" Width="190px"></asp:TextBox>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    Đầu số:
                </td>
                <td>
                    <asp:DropDownList ID="ddlTypeServiceIdSearch" runat="server" AutoPostBack="True"
                        OnSelectedIndexChanged="ddlTypeServiceIdSearch_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td style="width: 40px">
                </td>
                <td>
                    &nbsp;Nguời tạo
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtDeveloperSearch" Width="190px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:DropDownList ID="ddlServiceIdSearch" runat="server">
                    </asp:DropDownList>
                </td>
                <td style="width: 40px">
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="Tìm kiếm" />
                </td>
                <td style="width: 40px">
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </table>
    </div>
    <div style="margin: 10px 0px 4px 0px; border-top: solid 1px red;">
    </div>
    <div>
        <strong>
            <%#Eval("developer")%></strong>
    </div>
    <div>
        <table>
            <tr>
                <td>
                    Đối tác:
                </td>
                <td>
                    <asp:DropDownList ID="ddlPartner" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlPartner_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td style="width: 40px">
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    Đầu số:
                </td>
                <td>
                    <asp:DropDownList ID="ddlTypeServiceid" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlTypeServiceid_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td style="width: 40px">
                </td>
                <td>
                    Command Code:
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtCommand" Width="190px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:DropDownList ID="ddlServiceid" runat="server">
                    </asp:DropDownList>
                </td>
                <td style="width: 40px">
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    Sub Code:
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtSubCode" Width="190px"></asp:TextBox>
                </td>
                <td style="width: 40px">
                </td>
                <td>
                    File Dll
                </td>
                <td>
                    <asp:DropDownList ID="ddlFileDll" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlFileDll_SelectedIndexChanged">
                    </asp:DropDownList>
                    <br />
                </td>
            </tr>
            <tr>
                <td>
                    Nguời tạo
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtDeveloper" Width="190px"></asp:TextBox>
                </td>
                <td style="width: 40px">
                    &nbsp;
                </td>
                <td>
                    Class Xử Lý
                </td>
                <td>
                    <asp:DropDownList ID="ddlClassScript" runat="server">
                    </asp:DropDownList>
                    <asp:Button ID="btnViewDescriptionClass" runat="server" OnClick="btnViewDescriptionClass_Click"
                        Text="Xem Mô tả" />
                </td>
            </tr>
            <tr>
                <td>
                    Trạng thái:
                </td>
                <td>
                    <asp:CheckBox ID="chkStatus" runat="server" Checked="True" />
                </td>
                <td style="width: 40px">
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <asp:LinkButton runat="server" ID="LbtnAccept" OnClick="LbtnAccept_Click">Đồng ý</asp:LinkButton>
                </td>
                <td>
                    &nbsp;
                </td>
                <td style="width: 40px">
                </td>
                <td>
                    <asp:LinkButton runat="server" ID="LbtnSearch" OnClick="LbtnSearch_Click">Tìm kiếm</asp:LinkButton>
                </td>
                <td style="width: 70px">
                </td>
            </tr>
        </table>
    </div>
    <div style="margin: 10px 0px 4px 0px; border-top: solid 1px red;">
    </div>
    <div style="width: 100%; text-align: center;">
        <cc1:PagerV2_8 ID="pager1" runat="server" OnCommand="pager1_Command" PageSize="50"
            BackToFirstClause="Trang đầu" BackToPageClause="trở lại trang" GoToLastClause="Trang cuối"
            MaxSmartShortCutCount="0" NextToPageClause="trang tiếp theo" OfClause="của" PageClause="Trang"
            ShowResultClause="Hiện kết quả" CssClass="style2" FirstClause="Trang đầu" GenerateFirstLastSection="True"
            LastClause="Trang cuối" />
        <div>
            <strong>Tổng:
                <%=count %></strong></div>
        <asp:GridView ID="GrvListAcc" DataKeyNames="id" Width="100%" runat="server" AutoGenerateColumns="False"
            PageSize="50" CellPadding="4" ForeColor="#333333" GridLines="Vertical" EnableModelValidation="True"
            OnRowDataBound="GrvListAcc_RowDataBound" OnRowDeleting="GrvListAcc_RowDeleting">
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" HorizontalAlign="center" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <Columns>
                <asp:TemplateField HeaderText="STT">
                    <ItemTemplate>
                        <%=stt++ %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <input type="checkbox" id="chkAll" onclick="CheckUncheckAll('chk[]',this.checked);" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <input type="checkbox" id='chk' name="chk[]" value='<%# Eval("id") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="CommandCode">
                    <ItemTemplate>
                        <%#Eval("command_code")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="ShortCode">
                    <ItemTemplate>
                        <%#Eval("short_code")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="SubCode">
                    <ItemTemplate>
                        <%#Eval("subcodes")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Class xử lý">
                    <ItemTemplate>
                        <%#Eval("class_proccess")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Người tạo">
                    <ItemTemplate>
                        <%#Eval("developer")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Đối tác">
                    <ItemTemplate>
                        <%#Eval("partner_name")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Trạng thái">
                    <ItemTemplate>
                        <%#(Eval("status").ToString().Equals("1"))?"hoạt động":"khóa"%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Link mẫu">
                    <ItemTemplate>
                        <a href='<%#getLinkTest(int.Parse(Eval("partner").ToString()),int.Parse(Eval("id").ToString()))%>'>
                            Link mẫu</a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ToolTip="Xóa" Font-Overline="false" ForeColor="#007FD3" Text="Xóa"
                            CommandArgument='<%#Eval("id") %>' CommandName="Delete" ID="lbtnDel" runat="server">
                        </asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <a href='<%#Eval("id","SmsClass.aspx?id={0}") %>'>sửa</a>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
</asp:Content>
